class Foo {
	int value
}

List list = [new Foo(value: 2), new Foo(value: 1), new Foo(value: 10), new Foo(value: 7)]

// Groovy style
Collections.sort(list, {foo1, foo2 ->
	foo1.value - foo2.value
} as Comparator)

println list.value

// Java style, can not run in Groovy
Collections.sort(list, new Comparator<Foo>() {
	public int compare(Foo foo1, Foo foo2) {
		return foo1.value - foo2.value
	}
})


/* ################################################## */
// Multi methods.
def impl = [closure1: {println 'test'}, closure2: {str -> println str}] as MultiMethodInterface